package com.crm.controller;

import com.crm.entity.Askers;
import com.crm.entity.Student;
import com.crm.service.AskersService;
import com.crm.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.crm.util.FenyeUtil;

import java.util.List;

/**
 * @author 
 * @date 2020/5/7 17:09
 */
@RestController
@RequestMapping("/student")
public class StudentController {
    @Autowired
    private StudentService studentService;
    @Autowired
    private AskersService askersService;

    @GetMapping
    public FenyeUtil<Student> getAllStudent(Student student,Integer page,String userid){

        return  studentService.getAllStudent(student,page,userid);
    }
    @PostMapping
    public  String addStudent(Student student,String userId){
    	
       
        return  studentService.addStudent(student,userId);
    }
    @PutMapping
    public  String updateStudent(Student student){
         
        return  studentService.updateStudent(student);
    }
    @DeleteMapping
    public  String deleteStudent(String stuid){
        return  studentService.deleteStudent(stuid);
    }
  //查询已签到的所有咨询师
    @GetMapping("/askers")
    public List<Askers> GetAll(){
    	return askersService.GetQianDaoAll();
    }
    @PutMapping("/ShouFenPei")
    public Integer ShouFenPei(String Stuid,Integer askerId) {
    	return studentService.FenPeiStu(Stuid, askerId);
    }
}
